<template>
  <div id="head-section">
    <c-title :hide="false" text="我的钱包"></c-title>
    <div id="background_box"></div>
    <div class="detailBox">
      <div class="userImg" v-if="infoData.member">
        <img :src="infoData.member.avatar" alt="" />
      </div>
      <div class="userName" v-if="infoData.member">{{ infoData.member.nickname }}</div>
      <div class="levelBox">
        <div class="level">{{ infoData.level_name }}</div>
        <div class="levelTxt" v-if="infoData.member">{{ nameCheck }}{{ infoData.member.uid }}</div>
      </div>
      <div class="nextLevlTxt" @click="toRule" style="margin-top: 0.94rem;">距离下一个等级还差</div>
      <div class="nextLevlTxt" @click="toRule">{{ infoData.level_up_gap }}升级积分</div>
    </div>
    
  </div>
</template>
<script>
export default {
  props: ["infoData"],
  data() {
    return {
    };
  },
  methods: {
    toRule() {
      if (this.$route.name != "myWallet") {
        return;
      }
      this.$router.push(this.fun.getUrl("myWallet_rule"));
    }
  },
  computed: {
    nameCheck() {
      if (this.infoData.man_type == 1) {
        return "居民 ";
      } else if (this.infoData.man_type == 0) {
        return " ";
      } else {
        return "城主 ";
      }
    }
  }
};
</script>
<style lang="scss" scoped>
#background_box {
  min-height: 8.5rem;
  color: #382c0a;
  background: linear-gradient(180deg, #f15353 70%, #f5f5f5 100%);
  overflow: hidden;
}
.detailBox {
  // height: 0.78rem;
  background: #ffffff;
  border-radius: 0.5rem;
  margin: 0 0.75rem;
  margin-top: -5.56rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 0 0 1.06rem 0;
  box-sizing: border-box;
  .userImg {
    margin: -1.5rem auto;
    width: 3.7rem;
    height: 3.7rem;
    background: #737373;
    border-radius: 50%;
    border: 0.26rem solid #ffffff;
    img {
      width: 100%;
      height: 100%;
      border-radius: 50%;
    }
  }
  .userName {
    flex: 1;
    margin-top: 1.5rem;
    font-size: 1.13rem;
    font-weight: 500;
  }
  .nextLevlTxt {
    font-size: 0.81rem;
    color: #00001c;
  }
  .levelBox {
    margin-top: 0.66rem;
    height: 1.5rem;
    border-radius: 0.75rem;
    background: linear-gradient(270deg, #f51919 0%, #f85107 100%);
    display: flex;
    box-sizing: border-box;
    .level {
      background-image: url("https://mini-app-img-1251768088.cos.ap-guangzhou.myqcloud.com/images%2Flevel%402x.png");
      background-size: 100% 100%;
      background-repeat: no-repeat;
      width: 2.2rem;
      height: 2.5rem;
      margin-top: -0.3rem;
      font-weight: 500;
      font-size: 0.53rem;
      color: #ac3c12;
      line-height: 2.2rem;
      padding: 0 0.09rem;
      box-sizing: border-box;
      overflow: hidden;
      box-sizing: border-box;
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;
    }
    .levelTxt {
      padding-left: 0.38rem;
      padding-right: 0.25rem;
      box-sizing: border-box;
      font-weight: 500;
      font-size: 0.75rem;
      text-align: right;
      line-height: 1.5rem;
      color: #ffffff;
    }
  }
}
</style>
